package com.gao.service;

import com.gao.mapper.IUserInfoDao;
import com.gao.entity.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;


/**
 * Created by gml on 17/3/2.
 */
@Service("loginService")
public class LoginServiceImpl implements LoginService {
    @Autowired
    public IUserInfoDao userDao;

    @Override
    public UserInfo find(int id) {
        return userDao.getUserById(id);
    }

    @Override
    public void delete(int id) {
        userDao.delete(id);
    }

    @Override
    public void addUser(UserInfo userInfo) {
        userDao.addUser(userInfo);
    }

    @Override
    public ArrayList<UserInfo> findAll() {
        return userDao.findAll();
    }

    @Override
    public void update(UserInfo i) {
        userDao.update(i);
    }
}
